﻿package mortal.game.view.rebate.dayRecharge
{
    import com.gengine.global.*;
    import com.gengine.resource.*;
    import com.mui.controls.*;
    import extend.language.*;
    import mortal.component.window.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.game.view.rebate.openServerSevenDay.data.*;
    import mortal.mvc.interfaces.*;

    public class RebateRechargeModule extends BaseWindow
    {
        protected var _bottomBg:GImageBitmap;
        public var curPanel:RebateDayRechargePanel;

        public function RebateRechargeModule(param1:ILayer = null)
        {
            super(param1);
            setSize(900, 610 + 35);
            title = "" + Language.getString(71776);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._bottomBg = UIFactory.gImageBitmap(ImagesConst.RebatePanelBgDayRechargeBottom, 7, 218, this);
            LoaderHelp.addResCallBack(ResFileConst.rebate, this.onResLoadRebate);
            return;
        }// end function

        private function onResLoadRebate() : void
        {
            this.curPanel = UIFactory.getUICompoment(RebateDayRechargePanel, 7, 38, this);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            LoaderHelp.removeResEvent(ResFileConst.rebate, this.onResLoadRebate);
            this._bottomBg = null;
            this.curPanel = null;
            super.disposeImpl(param1);
            return;
        }// end function

        override public function show(param1:int = 0, param2:int = 0) : void
        {
            if (OpenServerSevenDayUtil.isNotOpenSpeActive())
            {
                return;
            }
            super.show();
            this.x = (Global.stage.stageWidth - this.width) / 2;
            this.y = (Global.stage.stageHeight - this.height) / 2;
            return;
        }// end function

    }
}
